<template>
  <div class="graph-relation-toolbar">
    <div
      class="u-item"
      v-show="screenDirection === 'normalScreen'"
      @click="changeFullScreen('fullScreen')"
    >
      <el-icon class="u-icon"><FullScreen /></el-icon>
      <div class="u-label">全屏</div>
    </div>
    <div
      class="u-item"
      v-show="screenDirection === 'fullScreen'"
      @click="changeFullScreen('normalScreen')"
    >
      <el-icon class="u-icon"><FullScreen /></el-icon>
      <div class="u-label">还原</div>
    </div>
  </div>
</template>

<script setup name="MGraphRelationToolbar">
import { ref } from 'vue'


const emit = defineEmits(['changeFullScreen'])

const screenDirection = ref('normalScreen') // fullScreen normalScreen

function changeFullScreen(d) {
  screenDirection.value = d
  emit('changeFullScreen', screenDirection.value)
}
</script>

<style lang="stylus" scoped>
.graph-relation-toolbar
  .u-item
    padding-top 6px
    width 44px
    height 44px
    text-align center
    color #616998
    cursor pointer
    background #fff
    border-radius: 6px;
  .u-icon
    margin 0 auto
    width 18px
    height 18px
    font-size 12px
    color #858FB7
  .u-label
    margin-top 1px
    font-size 12px
</style>
